home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-10-29 | 1.6 KB | 108 lines | [TEXT/CWIE] |
- // AMReminderApp.c -- application-level functions
-
- #include <Types.h>
- #include <Quickdraw.h>
- #include <Controls.h>
- #include <Events.h>
- #include <Lists.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <stdlib.h>
-
- #include "ResourceDefs.h"
- #include "Dispatcher.h"
-
- #include "AMReminderEngine.h"
- #include "AMReminderDoc.h"
- #include "AMWindow.h"
- #include "AMReminderApp.h"
-
-
- //----------
- AMReminderApp* NewAMReminderApp ()
- {
- AMReminderApp* app;
-
- app = (AMReminderApp*)malloc (sizeof (AMReminderApp));
- AMReminderApp_Init (app);
- SetClassID (app, classAMReminderApp);
-
- return app;
- }
-
- //----------
- void DeleteApp (
- AMApp* app)
- {
- AMReminderApp_Free ((AMReminderApp*)app);
- free (app);
- }
-
- /*----------*/
- void AMReminderApp_Init (
- AMReminderApp* self)
- {
- AMApp_Init ((AMApp*) self);
-
- self->super.mNumOpenTypes = 1;
- self->super.mOpenTypeList [0] = kFileType;
- }
-
- /*----------*/
- void AMReminderApp_Free (
- AMReminderApp* self)
- {
- AMApp_Free ((AMApp*) self);
- }
-
- /*----------*/
- AMDoc* MakeDoc (
- AMApp* self)
- {
- AMReminderDoc* doc = NewAMReminderDoc ();
-
- if (doc != nil) {
- //? add to list of docs
- }
-
- return (AMDoc*) doc;
- }
-
- /*----------*/
- void OpenApp (
- AMApp* self)
- {
- DoNew (self);
- }
-
- //----------
- Boolean DoAppCommand (
- AMApp* self,
- long inCommand)
- {
- Boolean result = true;
-
- switch (inCommand) {
- case cmdAbout:
- DoAbout (self);
- break;
- case cmdNew:
- DoNew (self);
- break;
- case cmdOpen:
- DoOpen (self);
- break;
- case cmdClose:
- DoClose (self);
- break;
- case cmdQuit:
- DoQuit (self);
- break;
-
- default:
- result = false;
- } // case
-
- return result;
- }
-